package com.hlkj.baidu_push;

import java.util.TreeMap;

public class RestApi extends TreeMap<String, String>
{
  public static final String _METHOD = "method";
  public static final String _APIKEY = "apikey";
  public static final String _TIMESTAMP = "timestamp";
  public static final String _SIGN = "sign";
  public static final String _EXPIRES = "expires";
  public static final String _V = "v";
  public static final String _USER_ID = "user_id";
  public static final String _CHANNEL_ID = "channel_id";
  public static final String _PUSH_TYPE = "push_type";
  public static final String _DEVICE_TYPE = "device_type";
  public static final String _MESSAGE_TYPE = "message_type";
  public static final String _MESSAGES = "messages";
  public static final String _MESSAGE_KEYS = "msg_keys";
  public static final String _MESSAGE_EXPIRES = "message_expires";
  public static final String _MESSAGE_IDS = "msg_ids";
  public static final String _NAME = "name";
  public static final String _START = "start";
  public static final String _LIMIT = "limit";
  public static final String _TAG = "tag";
  public static final String METHOD_QUERY_BIND_LIST = "query_bindlist";
  public static final String METHOD_PUSH_MESSAGE = "push_msg";
  public static final String METHOD_VERIFY_BIND = "verify_bind";
  public static final String METHOD_SET_TAG = "set_tag";
  public static final String METHOD_FETCH_TAG = "fetch_tag";
  public static final String METHOD_DELETE_TAG = "delete_tag";
  public static final String METHOD_QUERY_USER_TAG = "query_user_tags";
  public static final String METHOD_FETCH_MESSAGE = "fetch_msg";
  public static final String METHOD_FETCH_MSG_COUNT = "fetch_msgcount";
  public static final String METHOD_DELETE_MESSAGE = "delete_msg";
  public static final String METHOD_QUERY_DEVICE_TYPE = "query_device_type";
  public static final String PUSH_TYPE_USER = "1";
  public static final String PUSH_TYPE_TAG = "2";
  public static final String PUSH_TYPE_ALL = "3";
  public static final String DEVICE_TYPE_BROWSER = "1";
  public static final String DEVICE_TYPE_PC = "2";
  public static final String DEVICE_TYPE_ANDROID = "3";
  public static final String DEVICE_TYPE_IOS = "4";
  public static final String DEVICE_TYPE_WINDOWS_PHONE = "5";
  public static final String MESSAGE_TYPE_MESSAGE = "0";
  public static final String MESSAGE_TYPE_NOTIFY = "1";
  public static final Integer OPEN_TYPE_APP = Integer.valueOf(2);

  public static final Integer OPEN_TYPE_URL = Integer.valueOf(2);

  public static String mApiKey = "";

  public RestApi(String method) {
    put("method", method);
    put("apikey", mApiKey);
  }

  public String put(String key, String value)
  {
    if ((value == null) || (value.isEmpty()))
      return null;
    return (String)super.put(key, value);
  }
}